//
//  ITHomeViewCtrl.m
//  coderSinaWeiBo24
//
//  Created by 张雪雪 on 16/3/24.
//  Copyright © 2016年 www.xue.com. All rights reserved.
//

#import "ITHomeViewCtrl.h"
#import "ITTitleButton.h"
#import "ITTemp2Ctrl.h"
@interface ITHomeViewCtrl ()

@end

@implementation ITHomeViewCtrl

- (void)viewDidLoad {
    [super viewDidLoad];
    
//    UIButton * button = [[UIButton alloc]init];
//    [button setImage:[UIImage imageNamed:@"navigationbar_friendsearch"] forState:UIControlStateNormal];
//    [button setImage:[UIImage imageNamed:@"navigationbar_friendsearch_highlighted"] forState:UIControlStateHighlighted];
//    //根据图片的大小设置当前图片的大小
//    button.size = button.currentImage.size;
//    
//    self.navigationItem.leftBarButtonItem = [[UIBarButtonItem alloc]initWithCustomView:button];
   
    self.navigationItem.leftBarButtonItem = [UIBarButtonItem itemWithImageName:@"navigationbar_friendsearch" target:self action:@selector(friendsearch)];
    self.navigationItem.rightBarButtonItem = [UIBarButtonItem itemWithImageName:@"navigationbar_pop" target:self action:@selector(pop)];
    ITTitleButton *titleBtn = [[ITTitleButton alloc] init];
//    //设置标题的与图片
    [titleBtn setTitle:@"首页" forState:UIControlStateNormal];
    [titleBtn setImage:[UIImage imageNamed:@"navigationbar_arrow_down"] forState:UIControlStateNormal];

    //设置文字颜色
//    titleBtn.backgroundColor = [UIColor redColor];
    
    [titleBtn setTitleColor:[UIColor blackColor] forState:UIControlStateNormal];
   
    [titleBtn sizeToFit];
    
    self.navigationItem.titleView = titleBtn;
    
    
}

- (void)friendsearch{
    NSLog(@"%s",__func__);
    ITTemp2Ctrl *ctrl = [ITTemp2Ctrl new];
    
    //在push当前控制器的时候,指定底部的TabBar隐藏
    ctrl.hidesBottomBarWhenPushed = YES;
    
    [self.navigationController pushViewController:ctrl animated:YES];
    
}

- (void)pop{
    NSLog(@"%s",__func__);
//    NSArray *array = [NSArray arrayWithObject:@"哈哈"];
//    
//    NSLog(@"%@",array[2]);
    
}
- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.

}

#pragma mark - Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
#warning Incomplete implementation, return the number of sections
    return 0;
}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
#warning Incomplete implementation, return the number of rows
    return 0;
}

/*
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:<#@"reuseIdentifier"#> forIndexPath:indexPath];
    
    // Configure the cell...
    
    return cell;
}
*/



@end
